//
//  ViewController.m
//  iphoneX适配
//
//  Created by 陈晓军 on 2017/9/26.
//  Copyright © 2017年 陈晓军. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

// 是否为iphoneX设备
#define kDevice_Is_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [[UIScreen mainScreen] currentMode];
    if (kDevice_Is_iPhoneX) {
        NSLog(@"iphoneX");
        NSLog(@"%@",NSStringFromCGSize([UIScreen mainScreen].bounds.size));
    }else{
        NSLog(@"No iphoneX");
    }
    
    // Do any additional setup after loading the view, typically from a nib.
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
